<select name="<?php echo $name; ?>">
	<?php foreach ($nodes as $node):?>
	
	<?php 
		if(isset($sLevel)){
			if($node['level'] > $sLevel){
				continue;
			}else{
				unset($sLevel);
			}
		}
	?>
	
	<?php if($node['id'] == $explode):?>
		<?php
			$sLevel = $node['level'];
			continue; 
		?>	
	<?php endif;?>
	
	<option <?php if($node['id'] == $selected){echo "selected";}?> value="<?php echo $node['id']; ?>">
		<?php
			if($node['level'] == 0){
				echo '------';	
			}else{
				echo str_repeat('--',$node['level']).' '.$node['name'];
			}
			
		?>
	</option>
	
	<?php endforeach;?>			
</select>
